<template>
	<view class="">
		<view class="search-box">
			<u-search placeholder="请输入次卡名称" shape="square" v-model="keyword" :showAction="false"></u-search>
		</view>
		<view class="my-list">
			<u-list :height="swiperHeight" @scrolltolower="scrolltolower">
				<u-list-item v-for="(item, index) in indexList" :key="index">
					<div class="ul-item">
						<image class="img" :src="item.url" mode=""></image>
						<view class="txtc">
							<view class="ti">肩颈护理10次</view>
							<view class="dsc">消费商品: 肩颈护理10次</view>
							<view class="dsc">使用期限: 永久有效</view>
							<view class="pay" @click="$u.route('/pages/payment/pay')">
								<text class="tx">￥299</text>
								<view class="btn">购买</view>
							</view>
						</view>
					</div>
				</u-list-item>
			</u-list>
		</view>
	</view>
</template>

<script>
	import listHeightMixin from '@/common/computedAltitude.js'
	export default {
		mixins:[listHeightMixin],
		data() {
			return {
				keyword: '',
				indexList: [{
						url: 'https://cdn.uviewui.com/uview/album/1.jpg'
					},
					{
						url: 'https://cdn.uviewui.com/uview/album/2.jpg'
					},
					{
						url: 'https://cdn.uviewui.com/uview/album/3.jpg'
					},
					{
						url: 'https://cdn.uviewui.com/uview/album/4.jpg'
					},
					{
						url: 'https://cdn.uviewui.com/uview/album/5.jpg'
					},
					{
						url: 'https://cdn.uviewui.com/uview/album/6.jpg'
					},
					{
						url: 'https://cdn.uviewui.com/uview/album/7.jpg'
					},
					{
						url: 'https://cdn.uviewui.com/uview/album/8.jpg'
					},
					{
						url: 'https://cdn.uviewui.com/uview/album/9.jpg'
					},
					{
						url: 'https://cdn.uviewui.com/uview/album/10.jpg'
					}
				]
			}
		},
		methods: {
			scrolltolower() {
				console.log('pages')
			}
		}

	}
</script>

<style lang="scss" scoped>
	.search-box {
		padding: 20rpx;
		background-color: #fff;
	}
	.ul-item{
		width: 710rpx;
		margin:20rpx 0 0 20rpx;
		background-color:#fff;
		border-radius: 16rpx;
		overflow: hidden;
		display:flex;
		.img{
			display:block;
			border-radius: 20rpx;
			width: 200rpx;
			height:200rpx;
			flex-shrink: 0;
			
		}
		.txtc{
			margin-left: 20rpx;
			width: 100%;
			padding:20rpx;
			line-height: 1.4;
			.ti{
				font-size: 26rpx;
			}
			.dsc{
				font-size: 22rpx;
				color:#999;
			}
			.pay{
				display:flex;
				justify-content: space-between;
				align-items: center;
				.tx{
					font-size: 30rpx;
					color:#f00;
				}
				.btn{
					padding:10rpx 30rpx;
					border-radius: 15rpx;
					background-color:#000;
					color:#fff;
				}
			}
		}
	}
</style>
